//
//  BKMain_MyPrivilegeCell.m
//  bestkeep
//
//  Created by utouu666 on 17/2/14.
//  Copyright © 2017年 utouu. All rights reserved.
//

#import "BKMain_MyPrivilegeCell.h"
#import "BKMainCommon.h"
#import "BKIntegralViewController.h"
#import "BKPhoneCardsViewController.h"


@interface BKMain_MyPrivilegeCell()



@end


@implementation BKMain_MyPrivilegeCell
-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self initialize];
        self.backgroundColor = [UIColor whiteColor];
        
    }
    return self;
}

-(void)initialize{
    _typeImage = [[UIImageView alloc]init];
    [self addSubview:_typeImage];
    [_typeImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.mas_left).offset(0);
        make.top.mas_equalTo(self.mas_top).offset(12);
        make.bottom.mas_equalTo(self.mas_bottom).offset(-12);
        make.centerY.mas_equalTo(self.mas_centerY);
        make.width.mas_equalTo(self.typeImage.mas_height);
    }];
    
    _typeName = [UILabel new];
    _typeName.font = [Common boldSystemFontOfSize:14];
    _typeName.textColor = RGBACOLOR(0, 186, 156, 1);
    [self addSubview:_typeName];
    [_typeName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.typeImage.mas_right).offset(3);
        make.centerY.mas_equalTo(self.mas_centerY);
        make.height.mas_offset(@20);
    }];
    
    
    
}


- (void)fillData:(id)data{
    if (!data) {
        return;
    }
    if ([data isEqualToString:@"0"]) {
        self.typeName.text = @"积分签到";
        self.typeImage.image = [UIImage imageNamed:@"BKMain_icon_jf"];
    }else if ([data isEqualToString:@"1"]){
        self.typeName.text = @"手机充值";
        self.typeImage.image = [UIImage imageNamed:@"BKMain_icon_cz"];
    }else{
        self.typeName.text = @"我的VIP";
        self.typeImage.image = [UIImage imageNamed:@"BKMain_icon_vip"];
    }
    
    self.type = [NSString stringWithFormat:@"%@",data];
}
@end
